<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>adminer后台管理系统</title>
<link href="<{$APP_PUBLIC_PATH}>images/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<{$APP_PUBLIC_PATH}>javascript/jquery.min.js"></script>
<script type="text/javascript" src="<{$APP_PUBLIC_PATH}>javascript/jquery.form.js"></script>
<script src="lib/ckeditor/ckeditor.js" type="text/javascript"></script>
<script src="lib/ckfinder/ckfinder.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){ //这个就是传说的ready
		$("#main_big").slideToggle("slow");
});
</script>
</head>

<body style="background:#FFF">
<div id="big_pic"></div>
	<div id="main_big" style="display:none">编辑产品信息</div>
    <div id="main_contents">
    <div id="main_description">描述：编辑产品信息</div>
<script type="text/javascript">
$(document).ready(function(){ 
		$("#form1").slideDown("slow");
        $(".main_table tr:even").addClass("alt");
		$('#form2').ajaxForm(function(json) { 
		$('#pic_none').hide();
		var json = eval("("+json+")");
		var defaultpic = json.defaultpic;
		if(defaultpic == '1'){
			var idd = "first";
		}else{
			var idd = "setfirst";
		}
       		$('#pic_list').append('<li><a onclick="$.ajax({type: \'POST\',url: \'?m=Product&a=ajax_picture_del\',data: \'pid='+json.pid+'&photourl='+json.photourl+'\'});$(this).parents(\'#pic_list li\').hide();" class="pic_del"><img src="<{$APP_PUBLIC_PATH}>images/del.png" /></a><div><a target="_blank" href="Public/Uploads/m_'+json.photourl+'"><img src="Public/Uploads/s_'+json.photourl+'" title="'+$('#overview').val()+'" /></a></div><span title="'+$('#name').val()+'">'+$('#name').val()+'</span><a class="defaultpic" onclick="$.ajax({type: \'POST\',url: \'?m=Product&a=ajax_picture_default\',data: \'pid=<{$vo.product_id}>&photourl=<{$po.photourl}>\'});$(\'.defaultpic img\').attr(\'src\',\'<{$APP_PUBLIC_PATH}>images/setfirst.png\');$(this).find(\'img\').attr(\'src\',\'<{$APP_PUBLIC_PATH}>images/first.png\');"><img src="<{$APP_PUBLIC_PATH}>images/'+idd +'.png" /></a></li>'); 
			
    	},{dataType:'json'});
});
</script>
<iframe name="get" style="display:none;"></iframe>
<volist name="product" id="vo">
<div class="table_c" id="product_p">
<h1>上传产品图片</h1>
    <ul id="pic_list">
    <if condition="!empty($pic)">
		<volist name="pic" id="po">
    	<li><a onclick="$.ajax({type: 'POST',url: '?m=Product&a=ajax_picture_del',data: 'pid=<{$po.photo_id}>&photourl=<{$po.photourl}>'});$(this).parents('#pic_list li').hide();" class="pic_del"><img src="<{$APP_PUBLIC_PATH}>images/del.png" /></a><div><a target="_blank" id="big_pic_c" href="Public/Uploads/m_<{$po.photourl}>"><img src="Public/Uploads/s_<{$po.photourl}>" title="<{$po.overview}>" /></a></div><span title="<{$po.name}>"><{$po.name}></span>
        <if condition="$po.defaultpic eq '1'"><a class="defaultpic" onclick="$.ajax({type: 'POST',url: '?m=Product&a=ajax_picture_default',data: 'pid=<{$vo.product_id}>&photourl=<{$po.photourl}>'});$('.defaultpic img').attr('src','<{$APP_PUBLIC_PATH}>images/setfirst.png');$(this).find('img').attr('src','<{$APP_PUBLIC_PATH}>images/first.png');"><img src="<{$APP_PUBLIC_PATH}>images/first.png" /></a><else /><a class="defaultpic" onclick="$.ajax({type: 'POST',url: '?m=Product&a=ajax_picture_default',data: 'pid=<{$vo.product_id}>&photourl=<{$po.photourl}>'});$('.defaultpic img').attr('src','<{$APP_PUBLIC_PATH}>images/setfirst.png');$(this).find('img').attr('src','<{$APP_PUBLIC_PATH}>images/first.png');"><img src="<{$APP_PUBLIC_PATH}>images/setfirst.png" /></a></if></li>
        </volist>
    <else />
    	<div id="pic_none">没有图片记录</div>
    </if>    
    
    </ul>
    <div id="product_get">
   	  <form id="form2" name="form2" method="post" action="?m=Product&a=ajax_picture_up" enctype="multipart/form-data">
      <ul id="pic_get">
      <li><input name="pid" type="hidden" value="<{$vo.product_id}>" /><input type="file" name="picture_get" class="picture_get" /> 
        图片名称：<input type="text" name="name" id="name" /> 描述：<input type="text" name="overview" id="overview" style="width:300px;" /> 
        <input type="checkbox" name="defaultpic" id="defaultpic" value="1" /> 设为封面 
<input type="submit" name="news_file" id="news_file" value="上传" />
      </li>
      </ul>
      </form>
    </div>
</div>

<form id="form1" name="form1" method="post" target="get" style="display:none;" action="?m=Product&a=product_edit_get" enctype="multipart/form-data">
<input name="product_id" type="hidden" value="<{$vo.product_id}>" />
    <div id="table_c">
     	<table border="0" cellspacing="1" class="main_table">
       		 <tr>
            	<th colspan="2">编辑产品信息</th>
            </tr>
        	 <tr>
              <td align="right" valign="middle">产品名称</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="title" id="title" value="<{$vo.title}>" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">产品英文名称</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="e_title" id="e_title" value="<{$vo.e_title}>" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">产品分类</td>
              <td align="left" valign="middle">
              	<select name="sortid" id="sortid">
                    <volist name="sort1" id="so">
                    <option value="<{$so.sort_id}>"><{$so.title}></option>
                        <volist name="sort2" id="co">
                        <if condition="$so['sort_id'] eq $co['sid']">
                        <option value="<{$co.sort_id}>" style=" background:#CCC;"> &nbsp; &nbsp; |--<{$co.title}></option>
                        </if>
                        </volist>
                    </volist>
              	</select>
              <script type="text/javascript">
			  	$('#sortid').val('<{$vo.sortid}>');
			  </script>
              </td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">品牌</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="brand" id="brand" value="<{$vo.brand}>" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">编号</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="No" id="No" value="<{$vo.No}>" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">描述</td>
              <td align="left" valign="middle"><textarea class="input_c" name="overview" id="overview" cols="45" rows="5"><{$vo.overview}></textarea></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">英文描述</td>
              <td align="left" valign="middle"><textarea class="input_c" name="e_overview" id="e_overview" cols="45" rows="5"><{$vo.e_overview}></textarea></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">尺寸</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="sizes" id="sizes" value="<{$vo.sizes}>" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">英文尺寸</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="e_sizes" id="e_sizes" value="<{$vo.e_sizes}>" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">价格</td>
              <td align="left" valign="middle"><input class="input_c" type="text" name="price" id="price" value="<{$vo.price}>" /></td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">产品详细内容</td>
              <td align="left" valign="middle"><textarea class="input_c" name="contents" id="contents" cols="45" rows="5"><{$vo.contents}></textarea>
<script type="text/javascript">
var editor = CKEDITOR.replace( 'contents',
{
width:'80%',
height:'500'
});
CKFinder.SetupCKEditor(editor, 'lib/ckfinder/');
</script>
              </td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">产品英文内容</td>
              <td align="left" valign="middle"><textarea class="input_c" name="e_contents" id="e_contents" cols="45" rows="5"><{$vo.e_contents}></textarea>
              <script type="text/javascript">
var editor = CKEDITOR.replace( 'e_contents',
{
width:'80%',
height:'500'
});
CKFinder.SetupCKEditor(editor, 'lib/ckfinder/');
</script>
              </td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否会员产品</td>
              <td align="left" valign="middle"><input type="radio" name="memberproduct" id="memberproduct" value="1" <if condition='$vo.memberproduct eq 1'>checked="checked"</if> /> 是 <input type="radio" name="memberproduct" id="memberproduct" value="0" <if condition='$vo.memberproduct eq 0'>checked="checked"</if> /> 否</td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否最新产品</td>
              <td align="left" valign="middle"><input type="radio" name="newsproduct" id="newsproduct" value="1" <if condition='$vo.newsproduct eq 1'>checked="checked"</if> /> 是 <input type="radio" name="newsproduct" id="newsproduct" value="0" <if condition='$vo.newsproduct eq 0'>checked="checked"</if> /> 否</td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否促销产品</td>
              <td align="left" valign="middle"><input type="radio" name="specialproduct" id="specialproduct" value="1" <if condition='$vo.specialproduct eq 1'>checked="checked"</if> /> 是 <input type="radio" name="specialproduct" id="specialproduct" value="0" <if condition='$vo.specialproduct eq 0'>checked="checked"</if> /> 否</td>
             </tr>
        	 <tr>
              <td align="right" valign="middle">是否显示</td>
              <td align="left" valign="middle"><input type="radio" name="show_m" id="show_m" value="1" <if condition='$vo.show_m eq 1'>checked="checked"</if> /> 是 <input type="radio" name="show_m" id="show_m" value="0" <if condition='$vo.show_m eq 0'>checked="checked"</if> /> 否</td>
             </tr>

        </table>
</div>
            	  <input type="submit" name="button" id="button" class="main_get" value="提  交" />
        </form>
			</volist>
	</div>


</body>
</html>
